//
//  User.h
//  CoolTennisBall
//
//  Created by 谢伟康 on 15/12/23.
//  Copyright © 2015年 CoolLang. All rights reserved.
//

#import <Realm/Realm.h>
#import "UserInforItem.h"
#import "SportRecordItem.h"
#import "DataModel.h"
#import "DeviceInfo.h"
#import "TrackVideo.h"
#import "UserEquipModel.h"

@interface User : RLMObject

@property NSString * identification;
@property UserInforItem *userInforItem;
@property RLMArray<SportRecordItem> *sportRecordItems;
@property DeviceInfo *userDevice;
@property NSString * lastUploadTime;
@property RLMArray<TrackVideo> *trackVideos;
@property UserEquipModel *userEquipModel;

//获取user
+ (User *)getLastUser;

//分别从网络或蓝牙获取数据，经过滤后储存本地，从网络获取hasUpload为YES，从蓝牙获取hasUpload为NO
- (void)addSportRecordItemsObject:(NSArray *)sportRecordItems hasUpLoad:(BOOL)hasUpload;

////保存最新的上传时间戳
- (void)configureLastUploadTimeStamp:(NSString *)lastUploadTimeStamp;
@end

// This protocol enables typed collections. i.e.:
// RLMArray<User>
RLM_ARRAY_TYPE(User)
